// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill' // 模拟ES2015以上的环境，主要用于对ES6新语法不支持的浏览器
import promise from 'es6-promise'
promise.polyfill()

import Vue from 'vue'
import App from './App'
import router from './router'
// 引入element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import 'amfe-flexible'; //引入rem自适应

Vue.use(ElementUI);

Vue.config.productionTip = false


import Header from '@/components/common/header.vue'
Vue.component("Header", Header);

import Footer from '@/components/common/footer.vue'
Vue.component("Footer", Footer);

import Leftcard from '@/components/common/leftcard.vue'
Vue.component("Leftcard", Leftcard);


import CommonList from '@/components/common/commonList.vue'
Vue.component("CommonList", CommonList);

// 事件总线
Vue.prototype.$eventBus = new Vue()

var originalPush = router.push
router.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
